-- GENERATED SPELL FOR [Nether Ray] --


function spell0_18880(pUnit, Event) --@Drain Mana,Drain--
pUnit:FullCastSpellOnTarget(17008,pUnit:GetRandomPlayer(4))
pUnit:RegisterEvent('Sorts_18880', 5000, 1)
end

function spell1_18880(pUnit, Event) --@Nether Shock,n/a--
pUnit:FullCastSpellOnTarget(35334,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18880', 3316, 1)
end

function spell2_18880(pUnit, Event) --@Tail Sting,n/a--
pUnit:FullCastSpellOnTarget(36659,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18880', 16000, 1)
end

function Sorts_18880(pUnit, Event)
local choix_sorts_18880 = math.random(0, 2)
if choix_sorts_18880 == 0 then
pUnit:RegisterEvent('spell0_18880', 1, 1)
end
if choix_sorts_18880 == 1 then
pUnit:RegisterEvent('spell1_18880', 1, 1)
end
if choix_sorts_18880 == 2 then
pUnit:RegisterEvent('spell2_18880', 1, 1)
end
end

function mob18880_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18880', math.random(1500, 3000), 1)
end

function mob18880_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18880_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18880_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18880, 1, 'mob18880_Action')
RegisterUnitEvent(18880, 2, 'mob18880_Leave')
RegisterUnitEvent(18880, 3, 'mob18880_Kill')
RegisterUnitEvent(18880, 4, 'mob18880_Die')
